// ---------------------   左上task5 散点气泡图  --------------------------------------
function market6a(market_name = '华冠超市') {
    $.post('http://127.0.0.1:5000/data-api/task6a', {market_name: market_name}).done(function (data) {
        var myChart = echarts.init(document.querySelector(".rightUp .domz .chart1"));
        var option = {
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow',
                    borderColor: 'rgba(124,128,244, .5)',
                },
            },
            title:{
                text:'各省水果分科销量',
                left:'center',
                textStyle: {
                        fontSize:12,
                        color: '#f3f3f3'
                    },
            },
            grid: {
                top: '15%',
                left: '2%',
                right: '3%',
                bottom: '2%',
                containLabel: true
            },
            xAxis: {
                type: 'category',
                boundaryGap: true,
                data: data['产品分类'],
                axisLine: {
                    show: false
                },
                axisLabel: {
                    textStyle: {
                        color: '#f3f3f3'
                    },
                    rotate:45,
                    fontSize:9,

                },
                axisTick: {
                    show: false
                },
            },
            yAxis: {
                type: 'value',                
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: 'rgba(255,255,255,.2)',
                    }
                },
                axisLabel: {
                    formatter: '{value} 万',
                    textStyle: {
                        color: '#f3f3f3'
                    }
                },
                nameTextStyle: {
                    color: '#fff'
                },
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                scale: true
            },
            series: [
                {

                    type: 'scatter',
                    data: data['data'],
                    symbol: 'pin',
                    // 气泡大小
                    symbolSize: function (data) {
                        return data[1] * 3;
                    },
                    itemStyle: {
                        shadowBlur: 25,
                        shadowColor: 'rgba(25, 100, 150, 0.8)',
                        shadowOffsetY: 5,
                        color: '#1cd8a8',
                    }
                }
            ]
        };
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
});
}

// 启动|刷新 浏览器调用
market6a();
